module.exports = {
    type: 'list',
    async fetch({
        args,
        page
    }) {
    let items =[]
      let url =`http://baobab.kaiyanapp.com:80/api/v4/categories/all`
        let resp = await $http.get(url)
        let list  =resp.data.itemList
        
        
        for (i=3;i<list.length;i++)
      {
        let name =list[i].data.title
        let url=list[i].url
        let image =list[i].data.image
        let id =list[i].data.id
         cata(name,image,id)
       }
        
        function cata(name,image,id)
        { items.push({
        title: name,
        style: 'icon',
        spanCount:'4',
        thumb: image,
        id:id,
        route:$route('gc',{
          id:id})
        
      
            })
        }

      
        return {
          items: items
        }
    }
}